package com.dale.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dale.common.dto.BlogDto;
import com.dale.entity.Blog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author  ：dale
 * @since 2020-05-25
 */
@Mapper
public interface BlogMapper extends BaseMapper<Blog> {
    //获取文章的最大id  来推荐文章
    public Long getMaxId();

    //文章查询 只查询id content 为相似度功能推荐
    public List<BlogDto> getIdContentBlogs(Long id);

    IPage<BlogDto> selectAllBlogs(Page<BlogDto> page);

    public BlogDto getBlogDtoById(Long id);


    public IPage<BlogDto> searchBlog(Page<BlogDto> page,String searchContent);


    //查询今日点赞数最多的博客
    List<BlogDto> getMostLikeTodayBlog();

}
